package com.qf.Service.impl;

import com.qf.Dao.DoctorPointDao;
import com.qf.Dao.impl.DoctorPointDaoImpl;
import com.qf.Service.DoctorPointService;
import com.qf.entity.DoctorPoint;

import java.sql.SQLException;
import java.util.List;

public class DoctorPointServiceImpl implements DoctorPointService {
    private DoctorPointDao doctorPointDao = new DoctorPointDaoImpl();

    @Override
    public List<DoctorPoint> selectByPatientName(String patientName) {
        try {
            return doctorPointDao.selectByPatientName(patientName);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int addPatientName(DoctorPoint doctorPoint) {
        try {
            return doctorPointDao.updatePatientName(doctorPoint);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int updatePatientName(DoctorPoint doctorPoint) {
        try {
            return doctorPointDao.updatePatientName(doctorPoint);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public int deletePatientName(String patientName, String patient_Idcard) {
        try {
            return doctorPointDao.deletePatientName(patientName, patient_Idcard);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
